<%@ Page Title="Pay_Records Item" Language="C#" AutoEventWireup="true" CodeBehind="Pay_RecordsItem.aspx.cs" Inherits="Youz.CreditRepay.Manage.Pay_RecordsItem" %>
<script>
    //loadCSS("UIResources/Scripts/jquery.validate/valid.css");

    var requireJS = [
        //"assets/js/jquery.form.js"
    ];
    loadJS(requireJS);
</script><div class="row"><div class="col-lg-12"><div class="panel panel-default"><div class="panel-heading"><h2><i class="fa fa-edit"></i><%: R(LanguageModule.Pay_Records, "Pay_Records", "Pay_Records") %></h2></div><div class="panel-body"><form id="frm" class="form-horizontal" method="post" enctype="multipart/form-data" action="Right/Handlers/Pay_RecordsHandler.ashx?type=save"><input id="ID" name="ID" type="hidden" />
<div class="form-group">
<label class="control-label" for="PayType"><%: R(LanguageModule.Pay_Records, "PayType", "PayType") %></label>
<div class="controls"><input type="text" id="PayType" name="PayType" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="TradeNo"><%: R(LanguageModule.Pay_Records, "TradeNo", "TradeNo") %></label>
<div class="controls"><input type="text" id="TradeNo" name="TradeNo" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="TradeTime"><%: R(LanguageModule.Pay_Records, "TradeTime", "TradeTime") %></label>
<div class="controls"><input type="text" id="TradeTime" name="TradeTime" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="TradeName"><%: R(LanguageModule.Pay_Records, "TradeName", "TradeName") %></label>
<div class="controls"><textarea id="TradeName" name="TradeName" rows="3" maxlength="2000" class="form-control"></textarea></div>
</div>
<div class="form-group">
<label class="control-label" for="Payer"><%: R(LanguageModule.Pay_Records, "Payer", "Payer") %></label>
<div class="controls"><input type="text" id="Payer" name="Payer" maxlength="200" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Amount"><%: R(LanguageModule.Pay_Records, "Amount", "Amount") %></label>
<div class="controls"><input type="text" id="Amount" name="Amount" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Status"><%: R(LanguageModule.Pay_Records, "Status", "Status") %></label>
<div class="controls"><input type="text" id="Status" name="Status" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="CreateTime"><%: R(LanguageModule.Pay_Records, "CreateTime", "CreateTime") %></label>
<div class="controls"><input type="text" id="CreateTime" name="CreateTime" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="ModifyTime"><%: R(LanguageModule.Pay_Records, "ModifyTime", "ModifyTime") %></label>
<div class="controls"><input type="text" id="ModifyTime" name="ModifyTime" maxlength="8" class="form-control" /></div>
</div>
<div class="alert alert-danger" style="display: none;"><button type="button" class="close" data-dismiss="alert">×</button><strong>Oh snap!</strong><span class="content"></span></div><div class="form-actions"><button class="btn btn-success" type="submit" id="btnSubmit"><%: R(LanguageModule.M_Common, "btnSubmit", "保存修改") %></button>
						<button class="btn btn-default" type="button" id="btnCancel"><%: R(LanguageModule.M_Common, "btnCancel", "取消") %></button></div></form></div></div></div></div><script type="text/javascript">

    var flag = false;

    function validate() {
        return $("#frm").valid();
    };

    function get() {
        $.post("Pay/Handlers/Pay_RecordsHandler.ashx?type=get", { ID: "<%= WebHelper.Get("ID") %>" }, function (data) {
                $('#frm').fill(data);
            }, 'json');
        }

        $(function () {
            $("#frm").validate({
                errorElement: "span"
            });

            get();

            $("#frm").ajaxForm({
                dataType: 'json',
                beforeSubmit: function (arr, $form, options) {
                    if (flag) {
                        return false;
                    }
                    else {
                        flag = true;
                        return true;
                    }
                },
                success: function (data) {
                    if (data.isSuccess) {
                        loadPage("Pay/Pay_RecordsList.aspx");
                    }
                    else {
                        $(".alert > .content").html(data.message);
                        $(".alert").show();
                    }
                    flag = false;
                }
            });

            $("#btnCancel").click(function () {
                loadPage("Pay/Pay_RecordsList.aspx");				
            });
        });

</script>